import { CHANGETASKSACTIVATE } from "../constants"

const initState = {
    tasks: {
        task_data: [
            {
                key: 1,
                tasktitle: 'John Brown',
                bounty: 32,
                enddate: '2022-03-31',
                type_name: '人工智能',
                task_res: ['0'],
                email: '1123@qq.com',
                taskintro: '做后台',
                task_evi: 'xxxx'
            }
        ], 
    }
}

export default function TaskWorkerManagePageReducer (preState = initState, action) {
    const { type, data } = action
    switch (type) {
        case CHANGETASKSACTIVATE:
            return {
                ...preState,
                tasks: Object.assign({}, preState.tasks, data)
            }
        default:
            var state = preState
            return state
    }
}